package Web2.Registweb;

import Web2.Reginstservice.Reginstservice2;

import java.util.Scanner;

/**
 * web层收集用户注册信息
 */
public class Reginstweb2 {
    public static void main(String[] args) {
        //搜索信息
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入你要注册的用户名：");
        String username = scanner.next();
        //处理密码校检的逻辑
        Reginstservice2 rs = new Reginstservice2();
             int chek=rs.chek(username);
            if (chek>0){
                System.out.println("用户名已存在");
                return;
            }
        System.out.println("请您输入密码");
        String password = scanner.next();
        Integer regist = rs.regist(username, password);
        if (regist>0){
            System.out.println("恭喜你注册成功");
        }
    }
}
